<template>
  <div class="banner">
    <div class="left">
      <img src="../assets/logo.png" />
      <p>猫之巢&nbsp;&nbsp;&nbsp;&nbsp;猫咖后台管理系统</p>
    </div>
    <div class="right" slot="reference">
      <el-tooltip content="退出登录" placement="bottom">
        <i class="el-icon-switch-button" @click="logout()"></i>
      </el-tooltip>
    </div>
  </div>
</template>

<script>
export default {
  name: "CatcoffeeBanner",
  data() {
    return {};
  },
  methods: {
    logout() {
      window.localStorage.removeItem("staff");
      this.$axios.get("/staff/logout").then((res) => {
        this.$notify.success({
          title: "",
          message: "退出登录",
        });
      });
      this.$router.push("/login");
    },
  },
};
</script>

<style scoped>
.banner {
  display: flex;
  justify-content: space-between;
  background: #3e3e3e;
  height: 100px;
  box-sizing: border-box;
  padding: 35px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.62);
}
.banner .left {
  display: flex;
  color: white;
  font-size: 20px;
  font-weight: 600;
  align-items: center;
}
.banner .left img {
  margin-right: 15px;
  height: 50px;
}
.banner .right {
  position: relative;
}
.banner .right .transition-box p {
  line-height: 30px;
  text-align: center;
  color: white;
  font-size: 12px;
}
.banner .right i {
  color: white;
  font-size: 30px;
  transition-duration: 0.1s;
  font-weight: 600;
}
.banner .right i:hover {
  color: #ffd04b;
}
.transition-box {
  background: #3e3e3e;
  z-index: 100;
  position: absolute;
  left: -50px;
  text-align: center;
}
.transition-box a {
  line-height: 30px;
  width: 90px;
  padding: 0 10px;
}
</style>